package com.zxy.fmmall.service.impl;

import com.zxy.fmmall.dao.ProductParamsMapper;
import com.zxy.fmmall.entity.ProductParams;
import com.zxy.fmmall.service.ProductParamService;
import com.zxy.fmmall.service.ProductService;
import com.zxy.fmmall.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductParamServiceImpl implements ProductParamService {
    @Autowired
    private ProductParamsMapper productParamsMapper;

    @Override
    public ResultVo selectByBrand(Integer categoryId) {
        List<ProductParams> productParams = productParamsMapper.selectByBrand(categoryId);
        return ResultVo.ok().data("productParams",productParams);
    }

    @Override
    public ResultVo selectBrandByKeyword(String keyword) {
        List<ProductParams> productParams = productParamsMapper.selectBrandByKeyword(keyword);
        return ResultVo.ok().data("productParams",productParams);

    }
}
